#coding: utf-8
import serial,re,os
from common import *
from time import sleep
global ser
execfile('../import.cfg')
port = reset_test_port
while True:
    print 'reset ok'
    read_buf = ''
    ser = check_com_is_ok(port)
    if check_net_is_ok(ser):
        print 'test start'
        ser.close()
        sleep(2)
        os.system('main_basic_cmd '+port+' 115200 atlist.cfg log.xls 1')
        sleep(2)
        print 'start reset'
        ser = check_com_is_ok(port)
        ser.write('AT+RESET\r\n')
        ser.close()
